function matchedDS_out = rm_advm_vars(matchedDS)

% dedicated advm variable names
% advmVars = { ...
%     'R'         ,...
%     'ADVMTemp'  ,...
%     'Vbeam'     ,...
%     'alphaS'    ,...
%     'MeanSCB'   ,...
%     'MB'        ,...
%     'WCB'       ,...
%     'SCB'        ...
%     };

% keep ADVMTemp and Vbeam - MMD 2013-11-22
advmVars = { ...
    'R'         ,...
    'alphaS'    ,...
    'MeanSCB'   ,...
    'MB'        ,...
    'WCB'       ,...
    'SCB'        ...
    };

% get the variable names in the passed data set
matchedDSVarNames = matchedDS.Properties.VarNames;

% create a copy of the passed data set to return
matchedDS_out = matchedDS;

% remove advm variables from the output copy
for i = length(matchedDSVarNames):-1:1
    if any(strcmp(matchedDSVarNames{i},advmVars)) || ...
            any(strfind(matchedDSVarNames{i},'alphaS')) || ...
            any(strfind(matchedDSVarNames{i},'MeanSCB'))
        matchedDS_out.(matchedDSVarNames{i}) = [];
    end
end

% remove transformation of alphaS and MeanSCB from the output array
% for i = length(matchedDSVarNames):-1:1
%     if any(strcmp(matchedDSVarNames{i},'alphaS')) || ...
%             any(strcmp(matchedDSVarNames{i},'MeanSCB'))
%         matchedDS_out.(matchedDSVarNames{i}) = [];
%     end
% end